<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="./favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>BeConsole</title>
    <link href="./style/flex.css" rel="stylesheet" type="text/css" media="all" />
    <link href="./style/app.css" rel="stylesheet" type="text/css" media="all" />
    <link rel="stylesheet" href="./lib/jquery-ui.css">
    <link rel="stylesheet" href="./lib/jquery.terminal/jquery.terminal-2.14.1.css">
    <link rel="stylesheet" href="./lib/jquery.terminal/emoji.css">
    <link rel="stylesheet" href="./lib/jquery.contextmenu/jquery.contextMenu.css">
    <link rel="stylesheet" href="./index.css">
  </head>
  <body dragover.prevent>
    <div id="app"></div>
    
    <script>
    window.runtime = {
      serial: false ,
      platform: 'html5' ,
    }
    if(navigator.userAgent.toLowerCase().indexOf(' electron/') > -1) {
      runtime.platform = "electron"
      runtime.serial = "node"
      
      window.nodeRequire = require; 
      delete window.require;
      delete window.exports; delete window.module; 
    }
    else if(typeof process !== "undefined" && process.versions && process.versions["node-webkit"]){
      runtime.platform = "nw.js"
      runtime.serial = "chrome"
    }
    </script> 
    <script src="./lib/jquery.js"></script>
    <script src="./lib/jquery-ui.js"></script>
    <!-- <script src=" lib/jquery-1.12.0.min.js"></script> -->
    <script>
    if(runtime.platform == 'electron') {
      window.require = window.nodeRequire
    }
    // 禁止浏览器默认的拖放文件行为
    $(document).on({
      dragleave:function(e){
          e.preventDefault();
      },
      drop:function(e){
          e.preventDefault();
      },
      dragenter:function(e){
          e.preventDefault();
      },
      dragover:function(e){
          e.preventDefault();
      }
    })
    </script>
    <script src="./lib/jquery.terminal/sprintf.min.js"></script>
    <script src="./lib/jquery.terminal/jquery.terminal-2.14.1.js"></script>
    <script src="./lib/jquery.contextmenu/jquery.contextMenu.js"></script>
    <script src="./lib/jquery.ui.touch-punch.js"></script>
    <script src="./lib/jquery-mousewheel.js"></script>
    <script src="./lib/raphael.js"></script>
    <script src="./lib/iro.js"></script>
    
    <!-- scratch -->
    <script src="lib/scratch3/scratch-blocks/blockly_uncompressed_vertical.js"></script>
    <script src="lib/scratch3/msg/messages.js"></script>
    <script src="lib/scratch3/msg/scratch_msgs.js"></script>
    <script src="lib/scratch3/blocks_compressed.js"></script>
    <script src="lib/scratch3/blocks_compressed_vertical.js"></script>
    <script src="lib/scratch3/scratch-vm.js"></script>
    <script src="lib/scratch3/hack/BlocklyFieldDropdownAsync.js"></script>
    <script>
    Blockly.Categories.beparts = "bepart"
    Blockly.Colours.bepart = {
      primary: Blockly.Colours.motion.primary ,
      secondary: Blockly.Colours.motion.secondary ,
      tertiary: Blockly.Colours.motion.tertiary
    }
    </script>

    <!-- three.js -->
    <script src="lib/three/three.js"></script>
    <script src="lib/three/GLTFLoader.js"></script>
		<script src="lib/three/OrbitControls.js"></script>

    <!-- lvgl -->
    <script>
    var __dirname = "lib/lvgl.js"
    </script>
		<script src="lib/lvgl.js/lvgl_api.js"></script>
    <script>
    // 在 lvgl 初始化完毕后加载主程序 index.js
    // lvgl 是异步加载资源的
    Module.addOnInit(()=>{
      let script = document.createElement("script")
      script.type="module"
      script.crossorigin="crossorigin"
      script.src = "./index.js"
      document.body.appendChild(script)
    })
    </script>
  </body>
</html>
